
_test:     file format elf32-i386


Disassembly of section .text:

00000000 <main>:
#include "types.h"
#include "stat.h"
#include "user.h"

int main(){
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	83 e4 f0             	and    $0xfffffff0,%esp
   6:	83 ec 20             	sub    $0x20,%esp
  int *x;
  int i;
  for(i=0; i<10000; i++)
   9:	c7 44 24 18 00 00 00 	movl   $0x0,0x18(%esp)
  10:	00 
  11:	eb 15                	jmp    28 <main+0x28>
    x = malloc(sizeof(int));
  13:	c7 04 24 04 00 00 00 	movl   $0x4,(%esp)
  1a:	e8 e8 06 00 00       	call   707 <malloc>
  1f:	89 44 24 1c          	mov    %eax,0x1c(%esp)
#include "user.h"

int main(){
  int *x;
  int i;
  for(i=0; i<10000; i++)
  23:	83 44 24 18 01       	addl   $0x1,0x18(%esp)
  28:	81 7c 24 18 0f 27 00 	cmpl   $0x270f,0x18(%esp)
  2f:	00 
  30:	7e e1                	jle    13 <main+0x13>
    x = malloc(sizeof(int));
  *x = 55;
  32:	8b 44 24 1c          	mov    0x1c(%esp),%eax
  36:	c7 00 37 00 00 00    	movl   $0x37,(%eax)
  
  exit();
  3c:	e8 67 02 00 00       	call   2a8 <exit>
  41:	90                   	nop
  42:	90                   	nop
  43:	90                   	nop

00000044 <stosb>:
               "cc");
}

static inline void
stosb(void *addr, int data, int cnt)
{
  44:	55                   	push   %ebp
  45:	89 e5                	mov    %esp,%ebp
  47:	57                   	push   %edi
  48:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
  49:	8b 4d 08             	mov    0x8(%ebp),%ecx
  4c:	8b 55 10             	mov    0x10(%ebp),%edx
  4f:	8b 45 0c             	mov    0xc(%ebp),%eax
  52:	89 cb                	mov    %ecx,%ebx
  54:	89 df                	mov    %ebx,%edi
  56:	89 d1                	mov    %edx,%ecx
  58:	fc                   	cld    
  59:	f3 aa                	rep stos %al,%es:(%edi)
  5b:	89 ca                	mov    %ecx,%edx
  5d:	89 fb                	mov    %edi,%ebx
  5f:	89 5d 08             	mov    %ebx,0x8(%ebp)
  62:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
  65:	5b                   	pop    %ebx
  66:	5f                   	pop    %edi
  67:	5d                   	pop    %ebp
  68:	c3                   	ret    

00000069 <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  69:	55                   	push   %ebp
  6a:	89 e5                	mov    %esp,%ebp
  6c:	83 ec 10             	sub    $0x10,%esp
  char *os;

  os = s;
  6f:	8b 45 08             	mov    0x8(%ebp),%eax
  72:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
  75:	90                   	nop
  76:	8b 45 0c             	mov    0xc(%ebp),%eax
  79:	0f b6 10             	movzbl (%eax),%edx
  7c:	8b 45 08             	mov    0x8(%ebp),%eax
  7f:	88 10                	mov    %dl,(%eax)
  81:	8b 45 08             	mov    0x8(%ebp),%eax
  84:	0f b6 00             	movzbl (%eax),%eax
  87:	84 c0                	test   %al,%al
  89:	0f 95 c0             	setne  %al
  8c:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  90:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
  94:	84 c0                	test   %al,%al
  96:	75 de                	jne    76 <strcpy+0xd>
    ;
  return os;
  98:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  9b:	c9                   	leave  
  9c:	c3                   	ret    

0000009d <strcmp>:

int
strcmp(const char *p, const char *q)
{
  9d:	55                   	push   %ebp
  9e:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
  a0:	eb 08                	jmp    aa <strcmp+0xd>
    p++, q++;
  a2:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  a6:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  aa:	8b 45 08             	mov    0x8(%ebp),%eax
  ad:	0f b6 00             	movzbl (%eax),%eax
  b0:	84 c0                	test   %al,%al
  b2:	74 10                	je     c4 <strcmp+0x27>
  b4:	8b 45 08             	mov    0x8(%ebp),%eax
  b7:	0f b6 10             	movzbl (%eax),%edx
  ba:	8b 45 0c             	mov    0xc(%ebp),%eax
  bd:	0f b6 00             	movzbl (%eax),%eax
  c0:	38 c2                	cmp    %al,%dl
  c2:	74 de                	je     a2 <strcmp+0x5>
    p++, q++;
  return (uchar)*p - (uchar)*q;
  c4:	8b 45 08             	mov    0x8(%ebp),%eax
  c7:	0f b6 00             	movzbl (%eax),%eax
  ca:	0f b6 d0             	movzbl %al,%edx
  cd:	8b 45 0c             	mov    0xc(%ebp),%eax
  d0:	0f b6 00             	movzbl (%eax),%eax
  d3:	0f b6 c0             	movzbl %al,%eax
  d6:	89 d1                	mov    %edx,%ecx
  d8:	29 c1                	sub    %eax,%ecx
  da:	89 c8                	mov    %ecx,%eax
}
  dc:	5d                   	pop    %ebp
  dd:	c3                   	ret    

000000de <strlen>:

uint
strlen(char *s)
{
  de:	55                   	push   %ebp
  df:	89 e5                	mov    %esp,%ebp
  e1:	83 ec 10             	sub    $0x10,%esp
  int n;

  for(n = 0; s[n]; n++)
  e4:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  eb:	eb 04                	jmp    f1 <strlen+0x13>
  ed:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  f1:	8b 45 fc             	mov    -0x4(%ebp),%eax
  f4:	03 45 08             	add    0x8(%ebp),%eax
  f7:	0f b6 00             	movzbl (%eax),%eax
  fa:	84 c0                	test   %al,%al
  fc:	75 ef                	jne    ed <strlen+0xf>
    ;
  return n;
  fe:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 101:	c9                   	leave  
 102:	c3                   	ret    

00000103 <memset>:

void*
memset(void *dst, int c, uint n)
{
 103:	55                   	push   %ebp
 104:	89 e5                	mov    %esp,%ebp
 106:	83 ec 0c             	sub    $0xc,%esp
  stosb(dst, c, n);
 109:	8b 45 10             	mov    0x10(%ebp),%eax
 10c:	89 44 24 08          	mov    %eax,0x8(%esp)
 110:	8b 45 0c             	mov    0xc(%ebp),%eax
 113:	89 44 24 04          	mov    %eax,0x4(%esp)
 117:	8b 45 08             	mov    0x8(%ebp),%eax
 11a:	89 04 24             	mov    %eax,(%esp)
 11d:	e8 22 ff ff ff       	call   44 <stosb>
  return dst;
 122:	8b 45 08             	mov    0x8(%ebp),%eax
}
 125:	c9                   	leave  
 126:	c3                   	ret    

00000127 <strchr>:

char*
strchr(const char *s, char c)
{
 127:	55                   	push   %ebp
 128:	89 e5                	mov    %esp,%ebp
 12a:	83 ec 04             	sub    $0x4,%esp
 12d:	8b 45 0c             	mov    0xc(%ebp),%eax
 130:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
 133:	eb 14                	jmp    149 <strchr+0x22>
    if(*s == c)
 135:	8b 45 08             	mov    0x8(%ebp),%eax
 138:	0f b6 00             	movzbl (%eax),%eax
 13b:	3a 45 fc             	cmp    -0x4(%ebp),%al
 13e:	75 05                	jne    145 <strchr+0x1e>
      return (char*)s;
 140:	8b 45 08             	mov    0x8(%ebp),%eax
 143:	eb 13                	jmp    158 <strchr+0x31>
}

char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 145:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 149:	8b 45 08             	mov    0x8(%ebp),%eax
 14c:	0f b6 00             	movzbl (%eax),%eax
 14f:	84 c0                	test   %al,%al
 151:	75 e2                	jne    135 <strchr+0xe>
    if(*s == c)
      return (char*)s;
  return 0;
 153:	b8 00 00 00 00       	mov    $0x0,%eax
}
 158:	c9                   	leave  
 159:	c3                   	ret    

0000015a <gets>:

char*
gets(char *buf, int max)
{
 15a:	55                   	push   %ebp
 15b:	89 e5                	mov    %esp,%ebp
 15d:	83 ec 28             	sub    $0x28,%esp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 160:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 167:	eb 44                	jmp    1ad <gets+0x53>
    cc = read(0, &c, 1);
 169:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 170:	00 
 171:	8d 45 ef             	lea    -0x11(%ebp),%eax
 174:	89 44 24 04          	mov    %eax,0x4(%esp)
 178:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 17f:	e8 3c 01 00 00       	call   2c0 <read>
 184:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 187:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 18b:	7e 2d                	jle    1ba <gets+0x60>
      break;
    buf[i++] = c;
 18d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 190:	03 45 08             	add    0x8(%ebp),%eax
 193:	0f b6 55 ef          	movzbl -0x11(%ebp),%edx
 197:	88 10                	mov    %dl,(%eax)
 199:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
    if(c == '\n' || c == '\r')
 19d:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 1a1:	3c 0a                	cmp    $0xa,%al
 1a3:	74 16                	je     1bb <gets+0x61>
 1a5:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 1a9:	3c 0d                	cmp    $0xd,%al
 1ab:	74 0e                	je     1bb <gets+0x61>
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 1ad:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1b0:	83 c0 01             	add    $0x1,%eax
 1b3:	3b 45 0c             	cmp    0xc(%ebp),%eax
 1b6:	7c b1                	jl     169 <gets+0xf>
 1b8:	eb 01                	jmp    1bb <gets+0x61>
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
 1ba:	90                   	nop
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
 1bb:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1be:	03 45 08             	add    0x8(%ebp),%eax
 1c1:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 1c4:	8b 45 08             	mov    0x8(%ebp),%eax
}
 1c7:	c9                   	leave  
 1c8:	c3                   	ret    

000001c9 <stat>:

int
stat(char *n, struct stat *st)
{
 1c9:	55                   	push   %ebp
 1ca:	89 e5                	mov    %esp,%ebp
 1cc:	83 ec 28             	sub    $0x28,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 1cf:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
 1d6:	00 
 1d7:	8b 45 08             	mov    0x8(%ebp),%eax
 1da:	89 04 24             	mov    %eax,(%esp)
 1dd:	e8 06 01 00 00       	call   2e8 <open>
 1e2:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 1e5:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 1e9:	79 07                	jns    1f2 <stat+0x29>
    return -1;
 1eb:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 1f0:	eb 23                	jmp    215 <stat+0x4c>
  r = fstat(fd, st);
 1f2:	8b 45 0c             	mov    0xc(%ebp),%eax
 1f5:	89 44 24 04          	mov    %eax,0x4(%esp)
 1f9:	8b 45 f4             	mov    -0xc(%ebp),%eax
 1fc:	89 04 24             	mov    %eax,(%esp)
 1ff:	e8 fc 00 00 00       	call   300 <fstat>
 204:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 207:	8b 45 f4             	mov    -0xc(%ebp),%eax
 20a:	89 04 24             	mov    %eax,(%esp)
 20d:	e8 be 00 00 00       	call   2d0 <close>
  return r;
 212:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 215:	c9                   	leave  
 216:	c3                   	ret    

00000217 <atoi>:

int
atoi(const char *s)
{
 217:	55                   	push   %ebp
 218:	89 e5                	mov    %esp,%ebp
 21a:	83 ec 10             	sub    $0x10,%esp
  int n;

  n = 0;
 21d:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 224:	eb 24                	jmp    24a <atoi+0x33>
    n = n*10 + *s++ - '0';
 226:	8b 55 fc             	mov    -0x4(%ebp),%edx
 229:	89 d0                	mov    %edx,%eax
 22b:	c1 e0 02             	shl    $0x2,%eax
 22e:	01 d0                	add    %edx,%eax
 230:	01 c0                	add    %eax,%eax
 232:	89 c2                	mov    %eax,%edx
 234:	8b 45 08             	mov    0x8(%ebp),%eax
 237:	0f b6 00             	movzbl (%eax),%eax
 23a:	0f be c0             	movsbl %al,%eax
 23d:	8d 04 02             	lea    (%edx,%eax,1),%eax
 240:	83 e8 30             	sub    $0x30,%eax
 243:	89 45 fc             	mov    %eax,-0x4(%ebp)
 246:	83 45 08 01          	addl   $0x1,0x8(%ebp)
atoi(const char *s)
{
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
 24a:	8b 45 08             	mov    0x8(%ebp),%eax
 24d:	0f b6 00             	movzbl (%eax),%eax
 250:	3c 2f                	cmp    $0x2f,%al
 252:	7e 0a                	jle    25e <atoi+0x47>
 254:	8b 45 08             	mov    0x8(%ebp),%eax
 257:	0f b6 00             	movzbl (%eax),%eax
 25a:	3c 39                	cmp    $0x39,%al
 25c:	7e c8                	jle    226 <atoi+0xf>
    n = n*10 + *s++ - '0';
  return n;
 25e:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 261:	c9                   	leave  
 262:	c3                   	ret    

00000263 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 263:	55                   	push   %ebp
 264:	89 e5                	mov    %esp,%ebp
 266:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;
  
  dst = vdst;
 269:	8b 45 08             	mov    0x8(%ebp),%eax
 26c:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 26f:	8b 45 0c             	mov    0xc(%ebp),%eax
 272:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 275:	eb 13                	jmp    28a <memmove+0x27>
    *dst++ = *src++;
 277:	8b 45 f8             	mov    -0x8(%ebp),%eax
 27a:	0f b6 10             	movzbl (%eax),%edx
 27d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 280:	88 10                	mov    %dl,(%eax)
 282:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
 286:	83 45 f8 01          	addl   $0x1,-0x8(%ebp)
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 28a:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
 28e:	0f 9f c0             	setg   %al
 291:	83 6d 10 01          	subl   $0x1,0x10(%ebp)
 295:	84 c0                	test   %al,%al
 297:	75 de                	jne    277 <memmove+0x14>
    *dst++ = *src++;
  return vdst;
 299:	8b 45 08             	mov    0x8(%ebp),%eax
}
 29c:	c9                   	leave  
 29d:	c3                   	ret    
 29e:	90                   	nop
 29f:	90                   	nop

000002a0 <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret

SYSCALL(fork)
 2a0:	b8 01 00 00 00       	mov    $0x1,%eax
 2a5:	cd 40                	int    $0x40
 2a7:	c3                   	ret    

000002a8 <exit>:
SYSCALL(exit)
 2a8:	b8 02 00 00 00       	mov    $0x2,%eax
 2ad:	cd 40                	int    $0x40
 2af:	c3                   	ret    

000002b0 <wait>:
SYSCALL(wait)
 2b0:	b8 03 00 00 00       	mov    $0x3,%eax
 2b5:	cd 40                	int    $0x40
 2b7:	c3                   	ret    

000002b8 <pipe>:
SYSCALL(pipe)
 2b8:	b8 04 00 00 00       	mov    $0x4,%eax
 2bd:	cd 40                	int    $0x40
 2bf:	c3                   	ret    

000002c0 <read>:
SYSCALL(read)
 2c0:	b8 05 00 00 00       	mov    $0x5,%eax
 2c5:	cd 40                	int    $0x40
 2c7:	c3                   	ret    

000002c8 <write>:
SYSCALL(write)
 2c8:	b8 10 00 00 00       	mov    $0x10,%eax
 2cd:	cd 40                	int    $0x40
 2cf:	c3                   	ret    

000002d0 <close>:
SYSCALL(close)
 2d0:	b8 15 00 00 00       	mov    $0x15,%eax
 2d5:	cd 40                	int    $0x40
 2d7:	c3                   	ret    

000002d8 <kill>:
SYSCALL(kill)
 2d8:	b8 06 00 00 00       	mov    $0x6,%eax
 2dd:	cd 40                	int    $0x40
 2df:	c3                   	ret    

000002e0 <exec>:
SYSCALL(exec)
 2e0:	b8 07 00 00 00       	mov    $0x7,%eax
 2e5:	cd 40                	int    $0x40
 2e7:	c3                   	ret    

000002e8 <open>:
SYSCALL(open)
 2e8:	b8 0f 00 00 00       	mov    $0xf,%eax
 2ed:	cd 40                	int    $0x40
 2ef:	c3                   	ret    

000002f0 <mknod>:
SYSCALL(mknod)
 2f0:	b8 11 00 00 00       	mov    $0x11,%eax
 2f5:	cd 40                	int    $0x40
 2f7:	c3                   	ret    

000002f8 <unlink>:
SYSCALL(unlink)
 2f8:	b8 12 00 00 00       	mov    $0x12,%eax
 2fd:	cd 40                	int    $0x40
 2ff:	c3                   	ret    

00000300 <fstat>:
SYSCALL(fstat)
 300:	b8 08 00 00 00       	mov    $0x8,%eax
 305:	cd 40                	int    $0x40
 307:	c3                   	ret    

00000308 <link>:
SYSCALL(link)
 308:	b8 13 00 00 00       	mov    $0x13,%eax
 30d:	cd 40                	int    $0x40
 30f:	c3                   	ret    

00000310 <mkdir>:
SYSCALL(mkdir)
 310:	b8 14 00 00 00       	mov    $0x14,%eax
 315:	cd 40                	int    $0x40
 317:	c3                   	ret    

00000318 <chdir>:
SYSCALL(chdir)
 318:	b8 09 00 00 00       	mov    $0x9,%eax
 31d:	cd 40                	int    $0x40
 31f:	c3                   	ret    

00000320 <dup>:
SYSCALL(dup)
 320:	b8 0a 00 00 00       	mov    $0xa,%eax
 325:	cd 40                	int    $0x40
 327:	c3                   	ret    

00000328 <getpid>:
SYSCALL(getpid)
 328:	b8 0b 00 00 00       	mov    $0xb,%eax
 32d:	cd 40                	int    $0x40
 32f:	c3                   	ret    

00000330 <sbrk>:
SYSCALL(sbrk)
 330:	b8 0c 00 00 00       	mov    $0xc,%eax
 335:	cd 40                	int    $0x40
 337:	c3                   	ret    

00000338 <sleep>:
SYSCALL(sleep)
 338:	b8 0d 00 00 00       	mov    $0xd,%eax
 33d:	cd 40                	int    $0x40
 33f:	c3                   	ret    

00000340 <uptime>:
SYSCALL(uptime)
 340:	b8 0e 00 00 00       	mov    $0xe,%eax
 345:	cd 40                	int    $0x40
 347:	c3                   	ret    

00000348 <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 348:	55                   	push   %ebp
 349:	89 e5                	mov    %esp,%ebp
 34b:	83 ec 28             	sub    $0x28,%esp
 34e:	8b 45 0c             	mov    0xc(%ebp),%eax
 351:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 354:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 35b:	00 
 35c:	8d 45 f4             	lea    -0xc(%ebp),%eax
 35f:	89 44 24 04          	mov    %eax,0x4(%esp)
 363:	8b 45 08             	mov    0x8(%ebp),%eax
 366:	89 04 24             	mov    %eax,(%esp)
 369:	e8 5a ff ff ff       	call   2c8 <write>
}
 36e:	c9                   	leave  
 36f:	c3                   	ret    

00000370 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 370:	55                   	push   %ebp
 371:	89 e5                	mov    %esp,%ebp
 373:	83 ec 48             	sub    $0x48,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 376:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 37d:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 381:	74 17                	je     39a <printint+0x2a>
 383:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 387:	79 11                	jns    39a <printint+0x2a>
    neg = 1;
 389:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 390:	8b 45 0c             	mov    0xc(%ebp),%eax
 393:	f7 d8                	neg    %eax
 395:	89 45 ec             	mov    %eax,-0x14(%ebp)
 398:	eb 06                	jmp    3a0 <printint+0x30>
  } else {
    x = xx;
 39a:	8b 45 0c             	mov    0xc(%ebp),%eax
 39d:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }

  i = 0;
 3a0:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 3a7:	8b 4d 10             	mov    0x10(%ebp),%ecx
 3aa:	8b 45 ec             	mov    -0x14(%ebp),%eax
 3ad:	ba 00 00 00 00       	mov    $0x0,%edx
 3b2:	f7 f1                	div    %ecx
 3b4:	89 d0                	mov    %edx,%eax
 3b6:	0f b6 90 f0 07 00 00 	movzbl 0x7f0(%eax),%edx
 3bd:	8d 45 dc             	lea    -0x24(%ebp),%eax
 3c0:	03 45 f4             	add    -0xc(%ebp),%eax
 3c3:	88 10                	mov    %dl,(%eax)
 3c5:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
  }while((x /= base) != 0);
 3c9:	8b 45 10             	mov    0x10(%ebp),%eax
 3cc:	89 45 d4             	mov    %eax,-0x2c(%ebp)
 3cf:	8b 45 ec             	mov    -0x14(%ebp),%eax
 3d2:	ba 00 00 00 00       	mov    $0x0,%edx
 3d7:	f7 75 d4             	divl   -0x2c(%ebp)
 3da:	89 45 ec             	mov    %eax,-0x14(%ebp)
 3dd:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 3e1:	75 c4                	jne    3a7 <printint+0x37>
  if(neg)
 3e3:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 3e7:	74 2a                	je     413 <printint+0xa3>
    buf[i++] = '-';
 3e9:	8d 45 dc             	lea    -0x24(%ebp),%eax
 3ec:	03 45 f4             	add    -0xc(%ebp),%eax
 3ef:	c6 00 2d             	movb   $0x2d,(%eax)
 3f2:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)

  while(--i >= 0)
 3f6:	eb 1b                	jmp    413 <printint+0xa3>
    putc(fd, buf[i]);
 3f8:	8d 45 dc             	lea    -0x24(%ebp),%eax
 3fb:	03 45 f4             	add    -0xc(%ebp),%eax
 3fe:	0f b6 00             	movzbl (%eax),%eax
 401:	0f be c0             	movsbl %al,%eax
 404:	89 44 24 04          	mov    %eax,0x4(%esp)
 408:	8b 45 08             	mov    0x8(%ebp),%eax
 40b:	89 04 24             	mov    %eax,(%esp)
 40e:	e8 35 ff ff ff       	call   348 <putc>
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';

  while(--i >= 0)
 413:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 417:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 41b:	79 db                	jns    3f8 <printint+0x88>
    putc(fd, buf[i]);
}
 41d:	c9                   	leave  
 41e:	c3                   	ret    

0000041f <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 41f:	55                   	push   %ebp
 420:	89 e5                	mov    %esp,%ebp
 422:	83 ec 38             	sub    $0x38,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 425:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 42c:	8d 45 0c             	lea    0xc(%ebp),%eax
 42f:	83 c0 04             	add    $0x4,%eax
 432:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 435:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 43c:	e9 7e 01 00 00       	jmp    5bf <printf+0x1a0>
    c = fmt[i] & 0xff;
 441:	8b 55 0c             	mov    0xc(%ebp),%edx
 444:	8b 45 f0             	mov    -0x10(%ebp),%eax
 447:	8d 04 02             	lea    (%edx,%eax,1),%eax
 44a:	0f b6 00             	movzbl (%eax),%eax
 44d:	0f be c0             	movsbl %al,%eax
 450:	25 ff 00 00 00       	and    $0xff,%eax
 455:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 458:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 45c:	75 2c                	jne    48a <printf+0x6b>
      if(c == '%'){
 45e:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 462:	75 0c                	jne    470 <printf+0x51>
        state = '%';
 464:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 46b:	e9 4b 01 00 00       	jmp    5bb <printf+0x19c>
      } else {
        putc(fd, c);
 470:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 473:	0f be c0             	movsbl %al,%eax
 476:	89 44 24 04          	mov    %eax,0x4(%esp)
 47a:	8b 45 08             	mov    0x8(%ebp),%eax
 47d:	89 04 24             	mov    %eax,(%esp)
 480:	e8 c3 fe ff ff       	call   348 <putc>
 485:	e9 31 01 00 00       	jmp    5bb <printf+0x19c>
      }
    } else if(state == '%'){
 48a:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 48e:	0f 85 27 01 00 00    	jne    5bb <printf+0x19c>
      if(c == 'd'){
 494:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 498:	75 2d                	jne    4c7 <printf+0xa8>
        printint(fd, *ap, 10, 1);
 49a:	8b 45 e8             	mov    -0x18(%ebp),%eax
 49d:	8b 00                	mov    (%eax),%eax
 49f:	c7 44 24 0c 01 00 00 	movl   $0x1,0xc(%esp)
 4a6:	00 
 4a7:	c7 44 24 08 0a 00 00 	movl   $0xa,0x8(%esp)
 4ae:	00 
 4af:	89 44 24 04          	mov    %eax,0x4(%esp)
 4b3:	8b 45 08             	mov    0x8(%ebp),%eax
 4b6:	89 04 24             	mov    %eax,(%esp)
 4b9:	e8 b2 fe ff ff       	call   370 <printint>
        ap++;
 4be:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 4c2:	e9 ed 00 00 00       	jmp    5b4 <printf+0x195>
      } else if(c == 'x' || c == 'p'){
 4c7:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 4cb:	74 06                	je     4d3 <printf+0xb4>
 4cd:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 4d1:	75 2d                	jne    500 <printf+0xe1>
        printint(fd, *ap, 16, 0);
 4d3:	8b 45 e8             	mov    -0x18(%ebp),%eax
 4d6:	8b 00                	mov    (%eax),%eax
 4d8:	c7 44 24 0c 00 00 00 	movl   $0x0,0xc(%esp)
 4df:	00 
 4e0:	c7 44 24 08 10 00 00 	movl   $0x10,0x8(%esp)
 4e7:	00 
 4e8:	89 44 24 04          	mov    %eax,0x4(%esp)
 4ec:	8b 45 08             	mov    0x8(%ebp),%eax
 4ef:	89 04 24             	mov    %eax,(%esp)
 4f2:	e8 79 fe ff ff       	call   370 <printint>
        ap++;
 4f7:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 4fb:	e9 b4 00 00 00       	jmp    5b4 <printf+0x195>
      } else if(c == 's'){
 500:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 504:	75 46                	jne    54c <printf+0x12d>
        s = (char*)*ap;
 506:	8b 45 e8             	mov    -0x18(%ebp),%eax
 509:	8b 00                	mov    (%eax),%eax
 50b:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 50e:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 512:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 516:	75 27                	jne    53f <printf+0x120>
          s = "(null)";
 518:	c7 45 f4 e7 07 00 00 	movl   $0x7e7,-0xc(%ebp)
        while(*s != 0){
 51f:	eb 1f                	jmp    540 <printf+0x121>
          putc(fd, *s);
 521:	8b 45 f4             	mov    -0xc(%ebp),%eax
 524:	0f b6 00             	movzbl (%eax),%eax
 527:	0f be c0             	movsbl %al,%eax
 52a:	89 44 24 04          	mov    %eax,0x4(%esp)
 52e:	8b 45 08             	mov    0x8(%ebp),%eax
 531:	89 04 24             	mov    %eax,(%esp)
 534:	e8 0f fe ff ff       	call   348 <putc>
          s++;
 539:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
 53d:	eb 01                	jmp    540 <printf+0x121>
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 53f:	90                   	nop
 540:	8b 45 f4             	mov    -0xc(%ebp),%eax
 543:	0f b6 00             	movzbl (%eax),%eax
 546:	84 c0                	test   %al,%al
 548:	75 d7                	jne    521 <printf+0x102>
 54a:	eb 68                	jmp    5b4 <printf+0x195>
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 54c:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 550:	75 1d                	jne    56f <printf+0x150>
        putc(fd, *ap);
 552:	8b 45 e8             	mov    -0x18(%ebp),%eax
 555:	8b 00                	mov    (%eax),%eax
 557:	0f be c0             	movsbl %al,%eax
 55a:	89 44 24 04          	mov    %eax,0x4(%esp)
 55e:	8b 45 08             	mov    0x8(%ebp),%eax
 561:	89 04 24             	mov    %eax,(%esp)
 564:	e8 df fd ff ff       	call   348 <putc>
        ap++;
 569:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 56d:	eb 45                	jmp    5b4 <printf+0x195>
      } else if(c == '%'){
 56f:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 573:	75 17                	jne    58c <printf+0x16d>
        putc(fd, c);
 575:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 578:	0f be c0             	movsbl %al,%eax
 57b:	89 44 24 04          	mov    %eax,0x4(%esp)
 57f:	8b 45 08             	mov    0x8(%ebp),%eax
 582:	89 04 24             	mov    %eax,(%esp)
 585:	e8 be fd ff ff       	call   348 <putc>
 58a:	eb 28                	jmp    5b4 <printf+0x195>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 58c:	c7 44 24 04 25 00 00 	movl   $0x25,0x4(%esp)
 593:	00 
 594:	8b 45 08             	mov    0x8(%ebp),%eax
 597:	89 04 24             	mov    %eax,(%esp)
 59a:	e8 a9 fd ff ff       	call   348 <putc>
        putc(fd, c);
 59f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 5a2:	0f be c0             	movsbl %al,%eax
 5a5:	89 44 24 04          	mov    %eax,0x4(%esp)
 5a9:	8b 45 08             	mov    0x8(%ebp),%eax
 5ac:	89 04 24             	mov    %eax,(%esp)
 5af:	e8 94 fd ff ff       	call   348 <putc>
      }
      state = 0;
 5b4:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 5bb:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 5bf:	8b 55 0c             	mov    0xc(%ebp),%edx
 5c2:	8b 45 f0             	mov    -0x10(%ebp),%eax
 5c5:	8d 04 02             	lea    (%edx,%eax,1),%eax
 5c8:	0f b6 00             	movzbl (%eax),%eax
 5cb:	84 c0                	test   %al,%al
 5cd:	0f 85 6e fe ff ff    	jne    441 <printf+0x22>
        putc(fd, c);
      }
      state = 0;
    }
  }
}
 5d3:	c9                   	leave  
 5d4:	c3                   	ret    
 5d5:	90                   	nop
 5d6:	90                   	nop
 5d7:	90                   	nop

000005d8 <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 5d8:	55                   	push   %ebp
 5d9:	89 e5                	mov    %esp,%ebp
 5db:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;

  bp = (Header*)ap - 1;
 5de:	8b 45 08             	mov    0x8(%ebp),%eax
 5e1:	83 e8 08             	sub    $0x8,%eax
 5e4:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 5e7:	a1 0c 08 00 00       	mov    0x80c,%eax
 5ec:	89 45 fc             	mov    %eax,-0x4(%ebp)
 5ef:	eb 24                	jmp    615 <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 5f1:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5f4:	8b 00                	mov    (%eax),%eax
 5f6:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 5f9:	77 12                	ja     60d <free+0x35>
 5fb:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5fe:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 601:	77 24                	ja     627 <free+0x4f>
 603:	8b 45 fc             	mov    -0x4(%ebp),%eax
 606:	8b 00                	mov    (%eax),%eax
 608:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 60b:	77 1a                	ja     627 <free+0x4f>
free(void *ap)
{
  Header *bp, *p;

  bp = (Header*)ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 60d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 610:	8b 00                	mov    (%eax),%eax
 612:	89 45 fc             	mov    %eax,-0x4(%ebp)
 615:	8b 45 f8             	mov    -0x8(%ebp),%eax
 618:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 61b:	76 d4                	jbe    5f1 <free+0x19>
 61d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 620:	8b 00                	mov    (%eax),%eax
 622:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 625:	76 ca                	jbe    5f1 <free+0x19>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
 627:	8b 45 f8             	mov    -0x8(%ebp),%eax
 62a:	8b 40 04             	mov    0x4(%eax),%eax
 62d:	c1 e0 03             	shl    $0x3,%eax
 630:	89 c2                	mov    %eax,%edx
 632:	03 55 f8             	add    -0x8(%ebp),%edx
 635:	8b 45 fc             	mov    -0x4(%ebp),%eax
 638:	8b 00                	mov    (%eax),%eax
 63a:	39 c2                	cmp    %eax,%edx
 63c:	75 24                	jne    662 <free+0x8a>
    bp->s.size += p->s.ptr->s.size;
 63e:	8b 45 f8             	mov    -0x8(%ebp),%eax
 641:	8b 50 04             	mov    0x4(%eax),%edx
 644:	8b 45 fc             	mov    -0x4(%ebp),%eax
 647:	8b 00                	mov    (%eax),%eax
 649:	8b 40 04             	mov    0x4(%eax),%eax
 64c:	01 c2                	add    %eax,%edx
 64e:	8b 45 f8             	mov    -0x8(%ebp),%eax
 651:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 654:	8b 45 fc             	mov    -0x4(%ebp),%eax
 657:	8b 00                	mov    (%eax),%eax
 659:	8b 10                	mov    (%eax),%edx
 65b:	8b 45 f8             	mov    -0x8(%ebp),%eax
 65e:	89 10                	mov    %edx,(%eax)
 660:	eb 0a                	jmp    66c <free+0x94>
  } else
    bp->s.ptr = p->s.ptr;
 662:	8b 45 fc             	mov    -0x4(%ebp),%eax
 665:	8b 10                	mov    (%eax),%edx
 667:	8b 45 f8             	mov    -0x8(%ebp),%eax
 66a:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 66c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 66f:	8b 40 04             	mov    0x4(%eax),%eax
 672:	c1 e0 03             	shl    $0x3,%eax
 675:	03 45 fc             	add    -0x4(%ebp),%eax
 678:	3b 45 f8             	cmp    -0x8(%ebp),%eax
 67b:	75 20                	jne    69d <free+0xc5>
    p->s.size += bp->s.size;
 67d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 680:	8b 50 04             	mov    0x4(%eax),%edx
 683:	8b 45 f8             	mov    -0x8(%ebp),%eax
 686:	8b 40 04             	mov    0x4(%eax),%eax
 689:	01 c2                	add    %eax,%edx
 68b:	8b 45 fc             	mov    -0x4(%ebp),%eax
 68e:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 691:	8b 45 f8             	mov    -0x8(%ebp),%eax
 694:	8b 10                	mov    (%eax),%edx
 696:	8b 45 fc             	mov    -0x4(%ebp),%eax
 699:	89 10                	mov    %edx,(%eax)
 69b:	eb 08                	jmp    6a5 <free+0xcd>
  } else
    p->s.ptr = bp;
 69d:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6a0:	8b 55 f8             	mov    -0x8(%ebp),%edx
 6a3:	89 10                	mov    %edx,(%eax)
  freep = p;
 6a5:	8b 45 fc             	mov    -0x4(%ebp),%eax
 6a8:	a3 0c 08 00 00       	mov    %eax,0x80c
}
 6ad:	c9                   	leave  
 6ae:	c3                   	ret    

000006af <morecore>:

static Header*
morecore(uint nu)
{
 6af:	55                   	push   %ebp
 6b0:	89 e5                	mov    %esp,%ebp
 6b2:	83 ec 28             	sub    $0x28,%esp
  char *p;
  Header *hp;

  if(nu < 4096)
 6b5:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 6bc:	77 07                	ja     6c5 <morecore+0x16>
    nu = 4096;
 6be:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 6c5:	8b 45 08             	mov    0x8(%ebp),%eax
 6c8:	c1 e0 03             	shl    $0x3,%eax
 6cb:	89 04 24             	mov    %eax,(%esp)
 6ce:	e8 5d fc ff ff       	call   330 <sbrk>
 6d3:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 6d6:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 6da:	75 07                	jne    6e3 <morecore+0x34>
    return 0;
 6dc:	b8 00 00 00 00       	mov    $0x0,%eax
 6e1:	eb 22                	jmp    705 <morecore+0x56>
  hp = (Header*)p;
 6e3:	8b 45 f4             	mov    -0xc(%ebp),%eax
 6e6:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 6e9:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6ec:	8b 55 08             	mov    0x8(%ebp),%edx
 6ef:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 6f2:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6f5:	83 c0 08             	add    $0x8,%eax
 6f8:	89 04 24             	mov    %eax,(%esp)
 6fb:	e8 d8 fe ff ff       	call   5d8 <free>
  return freep;
 700:	a1 0c 08 00 00       	mov    0x80c,%eax
}
 705:	c9                   	leave  
 706:	c3                   	ret    

00000707 <malloc>:

void*
malloc(uint nbytes)
{
 707:	55                   	push   %ebp
 708:	89 e5                	mov    %esp,%ebp
 70a:	83 ec 28             	sub    $0x28,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 70d:	8b 45 08             	mov    0x8(%ebp),%eax
 710:	83 c0 07             	add    $0x7,%eax
 713:	c1 e8 03             	shr    $0x3,%eax
 716:	83 c0 01             	add    $0x1,%eax
 719:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 71c:	a1 0c 08 00 00       	mov    0x80c,%eax
 721:	89 45 f0             	mov    %eax,-0x10(%ebp)
 724:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 728:	75 23                	jne    74d <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 72a:	c7 45 f0 04 08 00 00 	movl   $0x804,-0x10(%ebp)
 731:	8b 45 f0             	mov    -0x10(%ebp),%eax
 734:	a3 0c 08 00 00       	mov    %eax,0x80c
 739:	a1 0c 08 00 00       	mov    0x80c,%eax
 73e:	a3 04 08 00 00       	mov    %eax,0x804
    base.s.size = 0;
 743:	c7 05 08 08 00 00 00 	movl   $0x0,0x808
 74a:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 74d:	8b 45 f0             	mov    -0x10(%ebp),%eax
 750:	8b 00                	mov    (%eax),%eax
 752:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 755:	8b 45 f4             	mov    -0xc(%ebp),%eax
 758:	8b 40 04             	mov    0x4(%eax),%eax
 75b:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 75e:	72 4d                	jb     7ad <malloc+0xa6>
      if(p->s.size == nunits)
 760:	8b 45 f4             	mov    -0xc(%ebp),%eax
 763:	8b 40 04             	mov    0x4(%eax),%eax
 766:	3b 45 ec             	cmp    -0x14(%ebp),%eax
 769:	75 0c                	jne    777 <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 76b:	8b 45 f4             	mov    -0xc(%ebp),%eax
 76e:	8b 10                	mov    (%eax),%edx
 770:	8b 45 f0             	mov    -0x10(%ebp),%eax
 773:	89 10                	mov    %edx,(%eax)
 775:	eb 26                	jmp    79d <malloc+0x96>
      else {
        p->s.size -= nunits;
 777:	8b 45 f4             	mov    -0xc(%ebp),%eax
 77a:	8b 40 04             	mov    0x4(%eax),%eax
 77d:	89 c2                	mov    %eax,%edx
 77f:	2b 55 ec             	sub    -0x14(%ebp),%edx
 782:	8b 45 f4             	mov    -0xc(%ebp),%eax
 785:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 788:	8b 45 f4             	mov    -0xc(%ebp),%eax
 78b:	8b 40 04             	mov    0x4(%eax),%eax
 78e:	c1 e0 03             	shl    $0x3,%eax
 791:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 794:	8b 45 f4             	mov    -0xc(%ebp),%eax
 797:	8b 55 ec             	mov    -0x14(%ebp),%edx
 79a:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 79d:	8b 45 f0             	mov    -0x10(%ebp),%eax
 7a0:	a3 0c 08 00 00       	mov    %eax,0x80c
      return (void*)(p + 1);
 7a5:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7a8:	83 c0 08             	add    $0x8,%eax
 7ab:	eb 38                	jmp    7e5 <malloc+0xde>
    }
    if(p == freep)
 7ad:	a1 0c 08 00 00       	mov    0x80c,%eax
 7b2:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 7b5:	75 1b                	jne    7d2 <malloc+0xcb>
      if((p = morecore(nunits)) == 0)
 7b7:	8b 45 ec             	mov    -0x14(%ebp),%eax
 7ba:	89 04 24             	mov    %eax,(%esp)
 7bd:	e8 ed fe ff ff       	call   6af <morecore>
 7c2:	89 45 f4             	mov    %eax,-0xc(%ebp)
 7c5:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 7c9:	75 07                	jne    7d2 <malloc+0xcb>
        return 0;
 7cb:	b8 00 00 00 00       	mov    $0x0,%eax
 7d0:	eb 13                	jmp    7e5 <malloc+0xde>
  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 7d2:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7d5:	89 45 f0             	mov    %eax,-0x10(%ebp)
 7d8:	8b 45 f4             	mov    -0xc(%ebp),%eax
 7db:	8b 00                	mov    (%eax),%eax
 7dd:	89 45 f4             	mov    %eax,-0xc(%ebp)
      return (void*)(p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
 7e0:	e9 70 ff ff ff       	jmp    755 <malloc+0x4e>
}
 7e5:	c9                   	leave  
 7e6:	c3                   	ret    
